/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.applicatioN.entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Slim
 */
@Entity
@Table(name = "langue")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Langue.findAll", query = "SELECT l FROM Langue l"),
    @NamedQuery(name = "Langue.findByIntitule", query = "SELECT l FROM Langue l WHERE l.intitule = :intitule")})
public class Langue implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "INTITULE")
    private String intitule;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "langue")
    private Collection<MaitriserL> maitriserLCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "langue")
    private Collection<Exiger1> exiger1Collection;

    public Langue() {
    }

    public Langue(String intitule) {
        this.intitule = intitule;
    }

    public String getIntitule() {
        return intitule;
    }

    public void setIntitule(String intitule) {
        this.intitule = intitule;
    }

    @XmlTransient
    public Collection<MaitriserL> getMaitriserLCollection() {
        return maitriserLCollection;
    }

    public void setMaitriserLCollection(Collection<MaitriserL> maitriserLCollection) {
        this.maitriserLCollection = maitriserLCollection;
    }

    @XmlTransient
    public Collection<Exiger1> getExiger1Collection() {
        return exiger1Collection;
    }

    public void setExiger1Collection(Collection<Exiger1> exiger1Collection) {
        this.exiger1Collection = exiger1Collection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (intitule != null ? intitule.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Langue)) {
            return false;
        }
        Langue other = (Langue) object;
        if ((this.intitule == null && other.intitule != null) || (this.intitule != null && !this.intitule.equals(other.intitule))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.applicatioN.entities.Langue[ intitule=" + intitule + " ]";
    }
    
}
